package codej.ast;

import codej.ast.*;
import static codej.ast.Option.*;
import codej.ast.*;

public class ForIteration extends ForControl {

	private final ForInit forInit;
	private final Expression expression;
	private final ForUpdate forUpdate;

	@Override
	public void accept(Visitor visitor) {
		visitor.visit(this);
	}

	public ForIteration(ForInit forInit, Expression expression, ForUpdate forUpdate) {
		this.forInit = forInit;
		this.expression = expression;
		this.forUpdate = forUpdate;
	}

	public ForInit getForInit() {
		return option(forInit, new ForInit());
	}
	
	public Expression getExpression() {
		return option(expression, new Expression());
	}

	public ForUpdate getForUpdate() {
		return option(forUpdate, new ForUpdate());
	}
}
